﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using OGS.Contracts;
using OGS.DataAccess;
using OGS.Utility;
namespace OGS.Web.Models.Admin
{
    public class UserListModel
    {
        public List<User> Users { get; set; }

        public SearchAttributes SearchAttributes { get; set; }
        /// <summary>
        /// Search 1
        /// </summary>
        [Display(Name = "Search 1")]
        public string Search1 { get; set; }
        /// <summary>
        /// Search 2
        /// </summary>
        [Display(Name = "Search 2")]
        public string Search2{ get; set; }
        /// <summary>
        /// Search 3
        /// </summary>
        [Display(Name = "Search 3")]
        public string Search3 { get; set; }
        /// <summary>
        /// Role
        /// </summary>
        public List<Role> Role { get; set; }

        /// <summary>
        /// Role id
        /// </summary>
        [Display(Name = "Role")]
        public int RoleID { get; set; }
        [Display(Name = "Bank Account Number")]
        /// <summary>
        /// Populate List
        /// </summary>
        /// <param name="SearchAttributes"></param>
        public void Populate(string Name, SearchAttributes SearchAttributes)
        {
            User oUser = new User();
            this.RoleID = 1;
            this.Users = DAUser.Instance.SearchUser(oUser, SearchAttributes);
        }
        /// <summary>
        /// Populate all active roles
        /// </summary>
        public void PopulateRoles()
        {
            this.Role = DARoles.Instance.GetAllActiveRoles();
        }
    }
}